Myweblogin Knowledge Base

Inserting Third Party Scripts

You will often have the need to insert Javascript or other files to your website.

 However you cannot insert script code into the rich text editor as the script information does not save.  Also sometimes if you insert the code into a section template it ,ay remove some of the code and or formatting rendering the script broken.

 Instead what we do is create a SSI (Server Side Include) file and insert this into the page instead.

Whilst this does not strictly comfort to W3C standards it is a simple and effective way to add a script to a page or your site.

You need to undertake three things:

Save the script as a TXT file

Save the File to a text file without the opening or closing script tags IE anyfilescript.txt

Add the TXT file to your File Library

Add the file to your file library (instructions here)

Insert the SSI File 

Insert the SSI code in the page or the Section template using the code:

<$ssi="/files/anyfilescript.txt">

Just change the bold to your actual file name.

Then publish the pages the the script will be there and working! 

Added: 2012-8-27 and last modified: 2018-10-25